package ${servicePackage};

import ${daoAllName};
import ${beanAllName};
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ${beanName}${servicePostfix} {

    @Autowired
    private ${beanName}${daoPostfix} ${beanName?lower_case}${daoPostfix};

    public Long save${beanName}(${beanName}${beanPostfix} ${beanPostfix?lower_case}){
        return ${beanName?lower_case}${daoPostfix}.save${beanName}(${beanPostfix?lower_case});
    }

    public Long save${beanName}List(List<${beanName}${beanPostfix}> list){
        return ${beanName?lower_case}${daoPostfix}.save${beanName}List(list);
    }

    public Long delete${beanName}ById(${(pri_type?contains("char"))?string("String","Long")} id){
        return ${beanName?lower_case}${daoPostfix}.delete${beanName}ById(id);
    }

    public Long update${beanName}ById(${beanName}${beanPostfix} ${beanPostfix?lower_case}){
        return ${beanName?lower_case}${daoPostfix}.update${beanName}ById(pojo);
    }

    public List<${beanName}${beanPostfix}> get${beanName}List(${beanName}${beanPostfix} ${beanPostfix?lower_case}){
        return ${beanName?lower_case}${daoPostfix}.get${beanName}List(pojo);
    }
}
